#ifndef SENSORUTILITY_GLOBAL_H
#define SENSORUTILITY_GLOBAL_H
#include <QtCore/qglobal.h>
#include <QImage>
#include <opencv/cv.h>

#ifdef SENSORUTILITY_LIB
# define SENSORUTILITY_EXPORT Q_DECL_EXPORT
#else
# define SENSORUTILITY_EXPORT Q_DECL_IMPORT
# pragma comment(lib, "SensorUtility.lib")
#endif

#pragma warning (disable:4251)
#pragma warning (disable:4275)
#pragma warning (disable:4996)
#pragma warning (disable:4005)

inline int qImageFormat2CvImageType (QImage::Format qformat) {
	switch (qformat)
	{
	case QImage::Format_Indexed8:
		return CV_8UC1;
	case QImage::Format_RGB16:
		return CV_16UC1;
	case QImage::Format_ARGB32:
	case QImage::Format_ARGB32_Premultiplied:
	case QImage::Format_RGB32:
		return CV_8UC4;
	default:
		throw ("qImageFormat2CvImageType: Unsupported format");
		break;
	}
}
#endif // SENSORUTILITY_GLOBAL_H
